package ne.aishuyuan.video.utils;

import org.apache.commons.io.FileUtils;

import java.io.File;
import java.io.IOException;
import java.net.MalformedURLException;
import java.net.URL;

/**
 * @param
 * @return
 */
public class DownloadUtil {
    public static  void downloadUrl(String sourceUrl,String destFile) {
        URL url = null;
        try {
            url = new URL(sourceUrl);
            FileUtils.copyInputStreamToFile(url.openStream(),new File(destFile));
        } catch (MalformedURLException e) {
            e.printStackTrace();
        } catch (IOException e) {
            e.printStackTrace();
        }
    }
}
